package com.mushuilingfeng.ddd.user.domain.user.repository;

import com.mushuilingfeng.ddd.framework.repository.IDomainRepository;
import com.mushuilingfeng.ddd.user.domain.base.DataPageResult;
import com.mushuilingfeng.ddd.user.domain.user.dto.UserQueryDto;
import com.mushuilingfeng.ddd.user.domain.user.entity.User;
import com.mushuilingfeng.ddd.user.domain.user.enums.UserStatusEnum;
import com.mushuilingfeng.ddd.user.domain.user.vo.UserPersonInfo;

/**
 * @author
 * @date 2024/9/27
 */
public interface IUserRepository extends IDomainRepository<User> {
    
    User findByLoginAccount(String loginAccount);
    
    User findByTelephone(String telephone);
    
    void updatePassword(Long userId, String newPassword);
    
    void incrementLoginErrorTimes(String userAccount);
    
    void clearLoginErrorTimes(String userAccount);
    
    int getLoginErrorTimes(String userAccount);
    
    DataPageResult<User> list(UserQueryDto dto);
    
    void updateNickName(Long userId, String nickName);
    
    void updateTelephone(Long userId, String telephone);
    
    void updatePersonInfo(Long userId, UserPersonInfo personInfo);
    
    void updateStatus(Long userId, UserStatusEnum status);
    
}
